package edu.ayit.service;

import edu.ayit.pojo.Blog;
import edu.ayit.vo.BlogQuery;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Map;

public interface BlogService {

    Blog getBlog(Long id);

    long countBlog();

    //获取根据id获取博客，并将博客内容转换为html格式
    Blog getBlogAndConvert(Long id);

    //分页查询，并传入查询参数
    Page<Blog> listBlog(Pageable pageable, BlogQuery blog);

    //分页查询用于页面展示
    Page<Blog> listBlog(Pageable pageable);

    //用于全局搜索
    Page<Blog> listBlog(Pageable pageable,String query);

    //根据标签id，查询博客
    Page<Blog> listBlog(Pageable pageable,Long tagId);

    Blog saveBlog(Blog blog);

    Blog updateBlog(Blog blog,Long id);

    void deleteBlog(Long id);

    List<Blog> getListTop(Integer size);

    //按照年份，查询博客集合
    Map<String,List<Blog>> archiveBlog();
}
